FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/golang:1.20.12-23 AS builder

WORKDIR /build

# 将代码复制到容器中
COPY . .

# 将我们的代码编译成二进制可执行文件app
#RUN go install ./cmd/mlss-cca-server/
RUN go install ./cmd/go-web/

FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/golang:1.20.12-23

WORKDIR /app

#COPY --from=builder /go/bin/mlss-cca-server .
COPY --from=builder /go/bin/go-web .
EXPOSE 8081

# 启动容器时运行的命令
#CMD ["./mlss-cca-server", "--port", "80"]
CMD ["./go-web"]
#CMD ["bash"]